#include<iostream>
#include <string>
using namespace std; 
class Solution {
public:
    bool isPalindrome(int x) {
        if (x < 0)return 0;
        string str = to_string(x);
        for (int i = 0; i < str.length() / 2; i++)
        {
            if (str[i] != str[str.length() - i  - 1])return 0;
        }
        return 1;
    }
};
int main()
{
    Solution s;
    int x = 121;
    cout << s.isPalindrome(x) << endl;
}